<template>
  <!-- vue3页面 -->
    <div>
        <el-button @click="two">222222</el-button>
        <p>data1:{{data1}}</p>
        <p>data2:{{data2}}</p>
    </div>
</template>

<script lang='ts'>
import { defineComponent, onActivated, onMounted, reactive ,ref,inject,Ref} from 'vue'
import emitter from '@/utils/bus'
export default defineComponent({
  name: 'App',
  setup() {

    const data1 = inject('data1') as Ref<string>
    const data2 = inject('data2') as Ref<boolean>


    const two = ()=>{
        data2.value = !data2.value
    }
    

    return {

        two,

        data1,
        data2,

    }
  }
})
</script>

<style scoped>
</style>